<!DOCTYPE html>
<!--
Copyright 2013 The Polymer Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->
<html>
  <head>
    <title></title>
    <meta charset="UTF-8">
    <script src="../../../platform.js"></script>
  </head>
  <body>
    <template>
       [template start]
       <template bind="{{}}">
         [inner template: <content></content>]
       </template>
      [template end]
    </template>
    <script>
      document.addEventListener('WebComponentsReady', function() {
        var t = document.querySelector('template');
        var p = Object.create(HTMLElement.prototype);
        p.readyCallback = function() {
          if (this.webkitCreateShadowRoot) {
            this.createShadowRoot = this.webkitCreateShadowRoot;
          }
          var root = this.createShadowRoot();
          root.appendChild(t.createInstance())
          HTMLTemplateElement.bindAllMustachesFrom_(root, {});
        }
        document.register('x-foo', {prototype: p});
        Model.notifyChanges();
      });
    </script>
    <x-foo>x-foo's light dom</x-foo>
  </body>
</html>
